<template>
  <div :class="['represen-work', $ua.isFromPc() ? 'z-web' : 'z-phone']">
    <div class="line" v-if="!$ua.isFromPc()"></div>
    <img  v-if="$ua.isFromPc()" :src="artFamousData[0]?.thumbnail" alt="">
    <div :class="[$ua.isFromPc() ? 'title' : 'phone-title']">
      <div>代表作</div>
    </div>
    <div class="famous-list" v-if="!$ua.isFromPc()">
      <div class="content" v-for="(item, i) in artFamousData" :key="i" @click="goDesc(item.data_id)">
        <img :src="item.thumbnail" alt="" class="image">
        <div class="work-info">
          <div class="name">
            {{ item.name }}
          </div>
          <div class="art-name">
            {{ item.art_name }}
          </div>
          <div class="opus_material">
            {{ item.opus_material }}
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import {getImgUrl} from '@/utils/downloadFile'
export default {
  props: ['artFamousData'],
  methods: {
    getImgUrl,
    goDesc(data_id) {
      console.log(type)
      this.$router.push({ path: '/artwork/desc', query: { data_id } })
    },
  }
}
</script>

<style lang="less" scoped>
  .represen-work {
    &.z-web {
      padding-bottom: 176px;
      background: #fff;
      img {
        width: 1644px;
        height: 860px;
      }

      .title {
        font-size: 44px;
        font-weight: 600;
        color: #000000;
        margin-left: 60px;
        vertical-align: top;
      }
    }

    &.z-phone {
      padding: 0 pxtorem(24) pxtorem(60);
      .line {
        width: 100%;
        height: 1px;
        background: #E8E8E8;
        margin-bottom: pxtorem(40);
      }

      .phone-title {
        font-size: pxtorem(36);
        font-weight: 600;
        color: #000000;
        letter-spacing: pxtorem(10);
        margin-bottom: pxtorem(32);
      }

      .famous-list {
        .content {
          display: flex;
          margin-bottom: pxtorem(40);
          &:last-child {
            margin-bottom: 0;
          }
          .image {
            width: pxtorem(300);
            height: pxtorem(200);
          }

          .work-info {
            margin-left: pxtorem(32);
            vertical-align: top;

            .name {
              font-size: pxtorem(22);
              font-weight: bold;
              color: #000;
              margin: pxtorem(24) 0 pxtorem(43);
            }

            .art-name,
            .opus_material {
              font-size: pxtorem(22);
              font-weight: bold;
              color: #999999;
            }

            .art-name {
              margin-bottom: pxtorem(15);
            }
          }
        }
      }
    }
  }
</style>